tools: add -e option to babl-icc-dumper, that shows exact fixed point values
authorØyvind Kolås <pippin@gimp.org>
Mon, 21 Aug 2017 16:11:43 +0000 (18:11 +0200)
committerØyvind Kolås <pippin@gimp.org>
Mon, 21 Aug 2017 16:17:35 +0000 (18:17 +0200)
tools/babl-icc-dump.c

index f28a2ded3bef896d544263c6f2a0d5893da649e7..4b549ef5bdd5a6a7fb4546147b147f789debf5cd 100644 (file)
@@ -645,14 +645,21 @@ file_get_contents (const char  *path,
 
 int main (int argc, char **argv)
 {
-  int i;
+  int i = 1;
   if (argc < 2)
   {
-    fprintf (stdout, "need one arg, an ICC profile file\n");
+    fprintf (stdout, "usage: babl-icc-dump [options] <file1.icc [file2.icc ...]>\n");
     return -1;
   }
 
-  for (i = 1; argv[i]; i++)
+  if (argv[i] && (!strcmp (argv[i], "-e") ||
+                  !strcmp (argv[i], "--exact")))
+  {
+    exact = 1;
+    i++;
+  }
+
+  for (; argv[i]; i++)
   {
     char *error = NULL;
     fprintf (stdout, "\nfile: %s\n", argv[i]);